# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudErrorReporting.V1beta1.Model.ServiceContext do
  @moduledoc """
  Describes a running service that sends errors. Its version changes over time and multiple versions can run in parallel.

  ## Attributes

  *   `resourceType` (*type:* `String.t`, *default:* `nil`) - Type of the MonitoredResource. List of possible values: https://cloud.google.com/monitoring/api/resources Value is set automatically for incoming errors and must not be set when reporting errors.
  *   `service` (*type:* `String.t`, *default:* `nil`) - An identifier of the service, such as the name of the executable, job, or Google App Engine service name. This field is expected to have a low number of values that are relatively stable over time, as opposed to `version`, which can be changed whenever new code is deployed. Contains the service name for error reports extracted from Google App Engine logs or `default` if the App Engine default service is used.
  *   `version` (*type:* `String.t`, *default:* `nil`) - Represents the source code version that the developer provided, which could represent a version label or a Git SHA-1 hash, for example. For App Engine standard environment, the version is set to the version of the app.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :resourceType => String.t() | nil,
          :service => String.t() | nil,
          :version => String.t() | nil
        }

  field(:resourceType)
  field(:service)
  field(:version)
end

defimpl Poison.Decoder, for: GoogleApi.CloudErrorReporting.V1beta1.Model.ServiceContext do
  def decode(value, options) do
    GoogleApi.CloudErrorReporting.V1beta1.Model.ServiceContext.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudErrorReporting.V1beta1.Model.ServiceContext do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
